import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: '登录页面',
      component: () => import('@/views/LoginView.vue')
    },
    {
      path: '/register',
      name: '注册页面',
      component: () => import('@/views/Register.vue')
    },
    {
      path: '/',
      name: 'Layout',
      // redirect: '/home',
      component: () => import('@/views/Layout.vue'),
      children: [
        {
          path: 'InAndOut',
          name: '进出库管理',
          component: () => import('../views/InAndOut.vue')
        },
        {
          path: 'Stock',
          name: '库存管理',
          component: () => import('../views/Stock.vue')
        },
        {
          path: 'GetInAndOut',
          name: '进出库查询',
          component: () => import('../views/GetInAndOut.vue')
        },
        {
          path: 'GetHistoryPrice',
          name: '历史价格查询',
          component: () => import('../views/GetHistoryPrice.vue')
        },
        {
          path: 'CategoryManagement',
          name: '品类管理',
          component: () => import('../views/CategoryManagement.vue')
        },
        {
          path: 'FirstLevel',
          name: '一级目录管理',
          component: () => import('../views/FirstLevel.vue')
        },
        {
          path: 'SecondLevel',
          name: '二级目录管理',
          component: () => import('../views/SecondLevel.vue')
        },
        {
          path: 'Vendor',
          name: '供应商管理',
          component: () => import('../views/Vendor.vue')
        },
        {
          path: 'Warehouse',
          name: '仓库管理',
          component: () => import('../views/Warehouse.vue')
        },
        {
          path: 'MonthlyProfitAndLossChart',
          name: '月盈亏图',
          component: () => import('../views/MonthlyProfitAndLossChart.vue')
        },
        {
          path: 'user',
          name: '用户管理',
          component: () => import('../views/UserView.vue')
        },
      ]
    }
  ]
})

export default router
